trigger CXGCampaignMemberAccount on CXG_Campaign_Accounts__c (after update){
    ID CxGcampaignmemberrecordtypeID = RecordTypeHelper.GetRecordTypeIdByDevName('CXG_Campaign_Accounts__c', 'Campaign_Member');       
    Set<Id> CampMemList = new Set<Id>();
    
   if(RecursiveCheck.firstRun2){
        
        for(CXG_Campaign_Accounts__c cam: trigger.new){
                   if(cam.RecordTypeId==CxGcampaignmemberrecordtypeID) {                                                             
                        if(cam.Control_Group_Member__c != Trigger.OldMap.get(cam.Id).Control_Group_Member__c){                        
                            CampMemList.add(cam.Customer__c);                            
                        }
                    }
                 }
                 CXGCampaignMemberAccountUpdate.CampaignMemberToAccountUpdate(CampMemList);
                 RecursiveCheck.firstRun2=False;
                    
    }   
}